package com.example.yupao_project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.yupao_project.entity.Team;
import com.example.yupao_project.entity.User;
import com.example.yupao_project.entity.infovo.TeamUserVo;
import com.example.yupao_project.entity.param.TeamJoinRe;
import com.example.yupao_project.entity.param.TeamQuery;
import com.example.yupao_project.entity.param.TeamQuitRe;
import com.example.yupao_project.entity.param.TeamUpdateRe;

import java.util.List;

/**
* @author 杰
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-05-03 19:15:23
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @param team 队伍信息
     * @param loginUser 当前登录用户
     * @return ResultUtils
     */
    Long addTeam(Team team, User loginUser) throws Exception;

    /**
     * 分页查询
     * @param teamQuery 查询信息
     * @param loginUser 登录用户信息
     * @return List<TeamUserVo>
     * @throws Exception
     */
    List<TeamUserVo> listTeams(TeamQuery teamQuery, User loginUser) throws Exception;

    /**
     * 更新队伍信息
     * @param teamUpdateRe 队伍信息
     * @param loginUser 登录用户
     * @return boolean
     */
    boolean updateTeam(TeamUpdateRe teamUpdateRe, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRe 加入队伍信息
     * @param user 登录用户信息
     * @return boolean
     */
    boolean joinTeam(TeamJoinRe teamJoinRe, User user);

    /**
     * 退出队伍
     * @param teamQuitRe 退出队伍信息
     * @param user 登录用户信息
     * @return boolean
     */
    boolean quit(TeamQuitRe teamQuitRe, User user);

    /**
     * 解散队伍
     * @param teamId 队伍id
     * @param user 登录用户
     * @return Boolean
     */
    Boolean delete(Long teamId, User user);
}
